package com.ys.service.business.impl;

import com.alibaba.fastjson.JSON;
import com.ys.entity.business.TpHolidaySet;
import com.ys.entity.business.TpTimeCheck;
import com.ys.mapper.business.DiySqlMapper;
import com.ys.mapper.business.TpTimeCheckMapper;
import com.ys.service.business.TpTimeCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("tpTimeCheckService")
public class TpTimeCheckServiceImpl implements TpTimeCheckService {
	
	@Autowired
	private DiySqlMapper diySqlMapper;
	@Autowired
	private TpTimeCheckMapper tpTimeCheckMapper;

	@Override
	public int add(Map<String, Object> params) {

		TpTimeCheck entity = JSON.parseObject(JSON.toJSONString(params), TpTimeCheck.class);
		entity.setStatus(1);
		return tpTimeCheckMapper.insert(entity);
	}

	@Override
	public List<Map<String, Object>> searchTimeCheck(String countMonthMin,String countMonthMax,int countType){

		return diySqlMapper.searchTimeCheck(countMonthMin,countMonthMax,countType);
	}

	@Override
	public void deleteTimeCheck(String countMonth){

		diySqlMapper.deleteTimeCheck(countMonth);
	}


}
